package com.lxmes.device.service.impl;

import java.util.List;
import com.lxmes.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lxmes.device.mapper.DeviceFailureInfoMapper;
import com.lxmes.device.domain.DeviceFailureInfo;
import com.lxmes.device.service.IDeviceFailureInfoService;

/**
 * 设备故障列表Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-11-29
 */
@Service
public class DeviceFailureInfoServiceImpl implements IDeviceFailureInfoService 
{
    @Autowired
    private DeviceFailureInfoMapper deviceFailureInfoMapper;

    /**
     * 查询设备故障列表
     * 
     * @param id 设备故障列表主键
     * @return 设备故障列表
     */
    @Override
    public DeviceFailureInfo selectDeviceFailureInfoById(Long id)
    {
        return deviceFailureInfoMapper.selectDeviceFailureInfoById(id);
    }

    /**
     * 查询设备故障列表列表
     * 
     * @param deviceFailureInfo 设备故障列表
     * @return 设备故障列表
     */
    @Override
    public List<DeviceFailureInfo> selectDeviceFailureInfoList(DeviceFailureInfo deviceFailureInfo)
    {
        return deviceFailureInfoMapper.selectDeviceFailureInfoList(deviceFailureInfo);
    }

    /**
     * 新增设备故障列表
     * 
     * @param deviceFailureInfo 设备故障列表
     * @return 结果
     */
    @Override
    public int insertDeviceFailureInfo(DeviceFailureInfo deviceFailureInfo)
    {
        deviceFailureInfo.setCreateTime(DateUtils.getNowDate());
        return deviceFailureInfoMapper.insertDeviceFailureInfo(deviceFailureInfo);
    }

    /**
     * 修改设备故障列表
     * 
     * @param deviceFailureInfo 设备故障列表
     * @return 结果
     */
    @Override
    public int updateDeviceFailureInfo(DeviceFailureInfo deviceFailureInfo)
    {
        deviceFailureInfo.setUpdateTime(DateUtils.getNowDate());
        return deviceFailureInfoMapper.updateDeviceFailureInfo(deviceFailureInfo);
    }

    /**
     * 批量删除设备故障列表
     * 
     * @param ids 需要删除的设备故障列表主键
     * @return 结果
     */
    @Override
    public int deleteDeviceFailureInfoByIds(Long[] ids)
    {
        return deviceFailureInfoMapper.deleteDeviceFailureInfoByIds(ids);
    }

    /**
     * 删除设备故障列表信息
     * 
     * @param id 设备故障列表主键
     * @return 结果
     */
    @Override
    public int deleteDeviceFailureInfoById(Long id)
    {
        return deviceFailureInfoMapper.deleteDeviceFailureInfoById(id);
    }
}
